package com.cn.test.record;

/**
 * description: 数组反转
 *
 * @author twj
 * @date 2021/7/20 16:15 .
 */
public class Reverse extends Test<String[], String[]> {
    @Override
    public String[] test(String[] param) {

        int left = 0, right = param.length - 1;
        while (right >= (param.length-1)/2) {
            String temp = param[left];
            param[left++]=param[right];
            param[right--]=temp;
//            left++;
//            right--;
        }
        return param;
    }
}
